package cn.sdack.go.users.dao;

import cn.sdack.go.common.entities.users.RegionEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @author sdack
 * @date 2024/2/22
 */

public interface RegionDao extends JpaRepository<RegionEntity, Long> {

    Page<RegionEntity> findAllByLevelAndDelIsNull(Integer level, Pageable pageable);

    List<RegionEntity> findAllByLevelAndDelIsNull(Integer level);

    RegionEntity findByCodeAndDelIsNull(Long code);

    List<RegionEntity> findAllByPidAndDelIsNull(Long pid);

    List<RegionEntity> findAllByPcodeAndDelIsNull(Long pcode);


}
